{% macro aoa_contributor(contributor) %}
  <div class="aoa-contributor">
    <a href="https://twitter.com/{{ contributor.username }}" target="_blank" class="avatar">
      <img src="{{ contributor.avatar }}" alt="{{ contributor.username }}" />
    </a>
    <div class="user-meta">
      <a href="https://twitter.com/{{ contributor.twitter_username }}" target="_blank">
        <span class="twittername">@{{ contributor.twitter_username }}</span>
      </a>

      {{ aoa_stat(_('Last Week'), contributor['1w']) }}
      {{ aoa_stat(_('Yesterday'), contributor['1d']) }}
      {{ aoa_stat(_('Overall'), contributor['all']) }}
    </div>
  </div>
{% endmacro %}

{% macro aoa_stat(name, value) %}
  {% if not value %}
    {% set value = 0 %}
  {% endif %}
  <div class="stat">
    <span class="count">{{ value }}</span>
    <span class="timeperiod">{{ name }}</span>
  </div>
{% endmacro %}
